import { Component, OnInit } from '@angular/core';
import { _HttpClient } from '@delon/theme';
import {ActivatedRoute, Router} from '@angular/router';

@Component({
  selector: 'app-point-recharge',
  templateUrl: './point-recharge.component.html',
    styleUrls: ['./point-recharge.component.less'],
})
export class PointRechargeComponent implements OnInit {

    pageInfo ={
        title :'积分充值',
        availPoint : '可用积分：',
        rechRuler:'充值规则：',
        rechAmount:'充值金额（元）：',
        rechStyle:'充值方式：',
        Balance:'账户余额'
    };

    pointInfo ={
        availPoint : 112,
        rechargeRuler: '1元=20积分',
        balance:'0.00',
    };
    isBalanChosen: boolean;
    isWarm: boolean;
    isChatShoen :boolean;

    showBalan(){
       this.isBalanChosen = true;
       this.isChatShoen = false;
    }

    ChatPay() {
        this.isBalanChosen = false;
        this.isChatShoen = true;
    }

    rechargeAmount;

    commit() {
        if(this.rechargeAmount == null || this.rechargeAmount == ''){
            this.isWarm = true;
        }else {
            this.isWarm = false;
            if(this.isBalanChosen) {

            }
            if(this.isChatShoen) {
                this.router.navigate(['/redeem/chat-pay' ,this.rechargeAmount]);
            }
        }
    }

    constructor(
        private http: _HttpClient,private route: ActivatedRoute, private router: Router,
    ) { }

    ngOnInit() {
    }

}
